import 'package:flutter/material.dart';

class MyListTile extends StatelessWidget {
  Widget title;
  Widget leading;
  GestureTapCallback pressed;
  Widget trailing;
  double leftPadding;
  double topBottomPadding;
  double rightPadding;

  MyListTile({Key key,
    this.pressed ,
    this.leftPadding = 10,
    this.topBottomPadding = 10,
    this.rightPadding = 0 ,
    @required this.title,
    @required this.leading,
    @required this.trailing});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        alignment: Alignment.center,
        padding: EdgeInsets.only(left: leftPadding,bottom: topBottomPadding,top: topBottomPadding,right: rightPadding),
        child: Row(
          mainAxisSize: MainAxisSize.max,
          children: <Widget>[
            leading,
            Padding(padding: EdgeInsets.only(left: leftPadding)),
            title,

            Expanded(child: Container(
              alignment: Alignment.centerRight,
              child: trailing,
            ))
          ],
        ),
      ),
      onTap: pressed,
    );
  }
}
